<%--
  Created by IntelliJ IDEA.
  User: shadowtu
  Date: 2018/11/26
  Time: 18:05
  To change this template use File | Settings | File Templates.
--%>
<%--销售机会添加页面--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/commons/layui/css/layui.css"/>
    <%--<link rel="stylesheet" href="/static/commons/layui/css/modules/laydate/default/laydate.css" />--%>
</head>
<body class="childrenBody">
<form class="layui-form" id="editForm">

    <div class="layui-inline">
        <div class="layui-input-inline">
            <%--<div class="layui-form-item">--%>
            <%--<label class="layui-form-label layui-bg-green layui-center">编号</label>--%>
            <%--<div class="layui-input-block">--%>
            <%--<input type="text" name="id" class="layui-input id" readonly/>--%>
            <%--</div>--%>
            <%--</div>--%>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-bg-green layui-center">成功机率</label>
                    <div class="layui-input-block">
                        <input type="text" name="successProbability" class="layui-input successProbability"/>
                    </div>
                </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-bg-green layui-center">客户名称</label>
                <div class="layui-input-block">
                    <select name="sname" lay-verify="required" lay-search id="sname">
                        <option value="">请选择</option>
                    </select>

                </div>
            </div>
            </div>
            <div class="layui-input-inline">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-bg-green layui-center">机会来源</label>
                    <div class="layui-input-block">
                        <input type="text" name="opportunitySource" placeholder="选填项"  autocomplete="off" class="layui-input opportunitySource"/>
                    </div>
                </div>
            </div>
    </div>

        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-green layui-center">概要</label>
            <div class="layui-input-block">
                <input type="text" name="outline" placeholder="请输入内容"  autocomplete="off" class="layui-input outline" style="width: 80%;"/>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-bg-green layui-center">联系人</label>
                    <div class="layui-input-block">
                        <input type="text" name="contacts" class="layui-input contacts"/>
                    </div>
                </div>
            </div>
            <div class="layui-input-inline">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-bg-green layui-center">联系电话</label>
                    <div class="layui-input-block">
                        <input type="text" name="contactsTel" class="layui-input contactsTel"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label layui-bg-green layui-center">机会描述</label>
            <div class="layui-input-block">
                <textarea name="opportunityDesc" placeholder="请输入内容" autocomplete="off" class="layui-textarea opportunityDesc"
                          style="width: 80%;"></textarea>
            </div>
        </div>

        <div class="layui-inline">
            <div class="layui-input-inline">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-bg-green layui-center">创建人</label>
                    <div class="layui-input-block">
                        <input type="text" name="assignName" class="layui-input assignName" value="${userInfo.name}" readonly/>
                    </div>
                </div>
            </div>
            <%--<div class="layui-input-inline">--%>
                <%--<div class="layui-form-item">--%>
                    <%--<label class="layui-form-label layui-bg-green layui-center">创建时间</label>--%>
                    <%--<div class="layui-input-block">--%>
                        <%--<input type="text" name="creationTime" class="layui-input creationTime" value="" readonly/>--%>
                    <%--</div>--%>
                <%--</div>--%>
            <%--</div>--%>
        <%--</div>--%>

        <%--&lt;%&ndash;<div class="layui-inline">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="layui-input-inline">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="layui-form-item">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<label class="layui-form-label layui-bg-green layui-center">指派人</label>&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="layui-input-block">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<input type="text" name="foundName" class="layui-input foundName"readonly/>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>

        <%--<div class="layui-form-item">--%>
        <%--<label class="layui-form-label layui-bg-green layui-center">指派人</label>--%>
        <%--<div class="layui-input-block foundName">--%>
        <%--<select name="foundName" lay-verify="required" lay-search id="customerNameSelect">--%>
        <%--<option value="">请选择</option>--%>
        <%--</select>--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--&lt;%&ndash;<div class="layui-inline">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="layui-input-inline">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="layui-form-item">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<label class="layui-form-label layui-bg-green layui-center">指派时间</label>&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="layui-input-block">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<input type="text" name="pointTime" class="layui-input pointTime"/>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
        <%--<div class="layui-input-inline">--%>
        <%--<div class="layui-form-item">--%>
        <%--<div class="layui-inline">--%>
        <%--<label class="layui-form-label layui-bg-green layui-center">指派时间</label>--%>
        <%--<div class="layui-input-inline ">--%>
        <%--&lt;%&ndash;<input id="pointTime" name="pointTime" class="layui-input" type="text">&ndash;%&gt;--%>
        <%--<input type="text" id="pointTime" name="pointTime" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input pointTime">--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--</div>--%>
</form>
<%--<script>--%>
<%--layui.use(['laydata'],function() {--%>
<%--let layda;--%>
<%--layda = layui.laydate;--%>
<%--layda.render({--%>
<%--elem: '#pointTime'--%>
<%--, min: -7--%>
<%--, max: 7--%>
<%--});--%>

<%--});--%>
<%--</script>--%>
<script type="text/javascript" src="/static/commons/layui/layui.js"></script>
<%--script type="text/javascript" src="../../static/commons/layui/lay/modules/laydate.js" ></script>--%>
<script type="text/javascript" src="/static/js/salesOpportunity/opportunityChance.js"></script>

<%--<script>--%>
<%--layui.use('laydate', function(){--%>
<%--var laydate = layui.laydate;--%>

<%--//执行一个laydate实例--%>
<%--laydate.render({--%>
<%--elem: '#pointTime',//指定元素--%>
<%--type: 'datetime',--%>
<%--done: function(value, date, endDate){--%>
<%--console.log(value);//得到日期生成的值，如：2017-08-18--%>
<%--console.log(typeof value);--%>
<%--// console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}--%>
<%--// console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。--%>
<%--}--%>
<%--});--%>
<%--laydate.render({--%>
<%--elem: '#pointTime'--%>
<%--,done: function(value, date, endDate){--%>
<%--console.log(value);//得到日期生成的值，如：2017-08-18--%>
<%--console.log(typeof value);--%>
<%--// console.log(date); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}--%>
<%--// console.log(endDate); //得结束的日期时间对象，开启范围选择（range: true）才会返回。对象成员同上。--%>
<%--}--%>
<%--});--%>
<%--});--%>
<%--</script>--%>

</body>
<script>
    layui.use(['jquery', 'form'], function () {
        let $ = layui.jquery,
            form = layui.form;

        $.get("/sales-opportunity/user", function (data) {
            data.data.customers.forEach(function (customer) {
                $("#sname").append("<option value='" + customer.customerName + "'>" + customer.customerName + "</option>");

            });
            form.render('select');
        });

    });


</script>
</html>
